//
//  OPZJNewCar.m
//  NewWorld
//
//  Created by 曾静 on 16/4/28.
//  Copyright © 2016年 itcast. All rights reserved.
//

#import "OPZJNewCar.h"
@interface OPZJNewCar()

@end
@implementation OPZJNewCar
+ (instancetype)highCarWithDict:(NSDictionary *)dict{
    id obj = [[self alloc] init];
    
    [obj setValuesForKeysWithDictionary:dict];
    
    return obj;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
}

+ (void)newsListWithURLString:(NSString *)URLString andParam:(NSDictionary *)parma finishedBlock:(FinishedBlock)finishedBlock{
    
}

//-(NSString *)description{
//    return [NSString stringWithFormat:@"%@,%@",self.name,self.url];
//}
+ (void)highCarWithURLString:(NSString *)URLString andParam:(NSDictionary *)parma finishedBlock:(FinishedBlock)finishedBlock{
    
    [[CZNetWorkTool sharedNetWorkTool]objectWithURLString:URLString andParam:parma completeBlock:^(id result) {
        NSDictionary *dict = (NSDictionary *)result;
        NSDictionary *dict1  = dict[@"data"];
//                NSLog(@"%@",dict1);
        NSMutableArray *marr = [NSMutableArray array];
        
        NSArray *array = dict1[@"carList"];
        for (NSDictionary *dict in array) {
            OPZJNewCar *highCar  = [OPZJNewCar highCarWithDict:dict];
            [marr addObject:highCar];
        }
        //        NSLog(@"%@",marr);
        if (finishedBlock) {
            finishedBlock(marr.copy);
        }
        
        
    }];
}

@end
